# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=at-spi2-core
pkgver=2.40.3
pkgrel=1
pkgdesc="Protocol definitions and daemon for D-Bus at-spi"
url="https://gitlab.gnome.org/GNOME/at-spi2-core"
arch=(x86_64)
license=(GPL2)
depends=(dbus glib2 libxtst libsystemd)
makedepends=(gobject-introspection git gtk-doc meson dbus-broker systemd)
optdepends=('dbus-broker: Alternative bus implementation')
_commit=57c644513133e9b7e259809302a25987eadfcc39  # tags/AT_SPI2_CORE_2_40_3^0
source=("git+https://gitlab.gnome.org/GNOME/at-spi2-core.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^AT_SPI2_CORE_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build \
    -D default_bus=dbus-broker \
    -D docs=true
  meson compile -C build
}

check() {
  # memory test fails without desktop
  # broker fails to launch without journald
  dbus-run-session meson test -C build --print-errorlogs || :
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 et:
